#ifndef LOGIN_H
#define LOGIN_H

#include <QtGui/QWidget>
#include <QString>
#include "constant.h"
#include "ui_login.h"
#include "links.h"

QT_BEGIN_NAMESPACE

class Ui_loginForm;

QT_END_NAMESPACE

class Login: public QWidget
{
    Q_OBJECT
private:
    Ui_loginForm *ui;
    QString m_account;
    QString m_passWord;
    ServerNode serverNode;
    Links *m_link;
    qint32 m_state;

public:
    Login(Links *link, QWidget *parent = 0);
    ~Login();

    bool checkConnectionButton();
    void setConnectedStatus();
    QString getAccount()
    { return m_account; }
    qint32 getState()
    { return m_state; }

signals:
    void stateChanged(qint32 state);
    void accountChanged(QString account);

public slots:
    void initStatus();
    void result(qint32 replyKind);
    void loginButtonClicked();
    void logoutButtonClicked();
    void serverDisconnected();
};

#endif